<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>两个变量的交换 </title>
    <script>
        //需求：尽可能多的使用方式实现两个变量的交换

        let a = 1;
        let b = 2;
        let c = 3;

        console.log(a, b, c);

        // let c = a;
        // a = b;
        // b = c;
        // console.log(a, b);



        // 以数组的形式进行值得交换
        [a, b, c] = [c, a, b]
        console.log(a, b, c);




    </script>
</head>

<body>

</body>

</html>